package com.hotel.service.Impl;

import com.hotel.entity.Room;
import com.hotel.mapper.RoomMapper;
import com.hotel.service.RoomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 夏智力
 * @FileName RoomServiceImpl
 * @date 2021/6/22 14:19
 * @Software: IntelliJ IDEA
 */
@Service
public class RoomServiceImpl implements RoomService {

    @Autowired
    private RoomMapper roomMapper;

    @Override
    public List<Room> selectRoom() {
        return roomMapper.selectRoom();
    }

    @Override
    public List<Room> selectRoomByTypeId(int typeId) {
        return roomMapper.selectRoomByTypeId(typeId);
    }

    @Override
    public List<Room> selectRoomByTypeName(String typeName) {
        return roomMapper.selectRoomByTypeName(typeName);
    }

    @Override
    public Room selectRoomByRoomName(String roomName) {
        return roomMapper.selectRoomByRoomName(roomName);
    }


    @Override
    public int addRoom(Room room) {
        return roomMapper.addRoom(room);
    }

    @Override
    public int updateRoom(Room room) {
        return roomMapper.updateRoom(room);
    }

    @Override
    public int deleteRoom(int id) {
        return roomMapper.deleteRoom(id);
    }
}
